using UnityEngine;

public class DestroyOnFall : MonoBehaviour
{
	public float fallDistance = 50f;

	private float initialHeight;

	private bool init = true;

	private void Start()
	{
	}

	private void LateUpdate()
	{
		if (!Game.IsLevelLoading())
		{
			if (init)
			{
				initialHeight = base.transform.position.y;
				init = false;
			}
			if (!init && initialHeight - base.transform.position.y > fallDistance)
			{
				Object.Destroy(base.gameObject);
			}
		}
	}
}
